package com.zxl.permission.dao;


import com.zxl.permission.entity.Token;
import com.zxl.permission.entity.User;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.sql.Timestamp;
import java.util.List;

@Component("loginDao")
public interface LoginDao {

    // 登录校验
    List<String> getPasswordFromUsername(@Param("username") String username);

    // 查询登录态token
    List<Token> getTokenFromUsername(@Param("username") String username);

    // 查询登录态username
    List<Token> getTokenFromToken(@Param("token") String token);

    // 创建登录态token
    void createTokenFromUsername(@Param("username") String username,
                                 @Param("token") String token,
                                 @Param("create_time") Timestamp create_time,
                                 @Param("active_time") Timestamp active_time);

    // 清除登录态token
    void deleteTokenFromUsername(@Param("username") String username);

    // 更新活跃时间
    void updateActiveTime(@Param("username") String username, @Param("active_time") Timestamp active_time);

}
